package com.yami.shop.controller;

import com.yami.shop.common.response.ServerResponseEntity;
import com.yami.shop.service.impl.RongYunAllMembersServiceImpl;
import io.rong.models.response.GroupMuteAllMembersCheckResult;
import io.rong.models.response.GroupMuteAllMembersListResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 群组禁言
 */
@RestController("rongYunAllMembersController")
@RequestMapping("/account/im/group/mute")
@Schema(description = "app-钱包IM群组禁言")
public class RongYunAllMembersController {

    @Autowired
    private RongYunAllMembersServiceImpl muteAllMembersService;

    @PostMapping("/group_mute_add")
    @Operation(summary =  "添加禁言群方法")
    public ServerResponseEntity<String> muteAllMembersAdd(@RequestBody List<String> groupIds) throws Exception {
        return muteAllMembersService.muteAllMembersAdd(groupIds);
    }

    @PostMapping("/group_mute_remove")
    @Operation(summary =  "移除禁言群方法")
    public ServerResponseEntity<String> muteAllMembersRemove(@RequestBody List<String> groupIds) throws Exception {
        return muteAllMembersService.muteAllMembersRemove(groupIds);
    }

    @GetMapping( "/group_mute_list")
    @Operation(summary =  "查询所有设置禁言群方法")
    public ServerResponseEntity<GroupMuteAllMembersListResult> muteAllMembersGetList() throws Exception {
        return muteAllMembersService.muteAllMembersGetList();
    }


    @PostMapping("/group_mute_check")
    @Operation(summary =  "检查禁言群方法")
    public ServerResponseEntity<GroupMuteAllMembersCheckResult> muteAllMembersCheck(@RequestBody List<String> groupIds) throws Exception {
        return muteAllMembersService.muteAllMembersCheck(groupIds);
    }


}
